<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        * {
            margin: 0;
            padding: 0;
        }

        body {
            padding-top: 100px;
        }

        .box {
            width: 200px;
            height: 300px;
            background-color: #e02a20;
            margin: auto;
            display: flex;
            flex-direction: column;
            justify-content: end;
            padding: 20px;
        }

        ul {
            list-style: none;
            display: flex;
            justify-content: center;
        }

        li {
            padding: 8px 4px;
            color: #fff;
            font-size: 24px;
        }

        li:nth-child(2n + 1) {
            background-color: #000;
        }
    </style>
</head>

<body>
    <div class="box">
        <ul>
            <li id="h">05</li>
            <li>:</li>
            <li id="m">10</li>
            <li>:</li>
            <li id="s">12</li>
        </ul>
    </div>
    <script>
        let elh = document.getElementById('h')
        let elm = document.getElementById('m')
        let els = document.getElementById('s')

        let h = 5;
        let m = 10;
        let s = 12;
        let timer = setInterval(function () {
            s--;
            if (s < 0) {
                s = 59;
                m--;
            }
            if (m < 0) {
                m = 59;
                h--;
            }

            if (s === 0 && m === 0 & h === 0) {
                clearInterval(timer);
            }

            let textH = h < 10 ? '0' + h : h;
            let textM = m < 10 ? '0' + m : m;
            let textS = s < 10 ? '0' + s : s;

            elh.innerText = textH;
            elm.innerText = textM;
            els.innerText = textS;
        }, 1000);
    </script>
</body>

</html>